﻿//------------------------------------------------监控------------------------------------------------
function bppm_post(URL, PARAMS) {
    var temp = document.createElement("form");
    temp.action = URL;
    temp.method = "post";
    temp.name = "myform";
    temp.id = "loginForm";
    temp.target = "_blank";
    temp.style.display = "none";
    for (var x in PARAMS) {
        var opt = document.createElement("input");
        opt.name = x;
        opt.value = PARAMS[x];
        // alert(opt.name)        
        temp.appendChild(opt);
    }
    document.body.appendChild(temp);
    temp.submit();
    return temp;
}

function redirectbppm(URL, userdept, usercompany) {
    var user = 'portal';
    var pwd = 'Portal1234';
    if (userdept == '省局机关运维') {
        user = 'shengju';
        pwd = 'shengju123';
    }
    if (usercompany == '三明金叶复烤有限公司') {
        user = 'jyfk';
        pwd = 'jyfk123';
    }
    if (usercompany == '中国烟草福建进出口公司') {
        user = 'jck';
        pwd = 'jck1234';
    }
    if (usercompany == '福建烟草海晟投资管理有限公司') {
        user = 'haitou';
        pwd = 'haitou123';
    }
    bppm_post(URL, { sub: "Submit", login: user, password: pwd });
    return false;
}

//------------------------------------------------报表------------------------------------------------
function report_post(URL, PARAMS) {
    var temp = document.createElement("form");
    temp.action = URL;
    temp.method = "post";
    temp.name = "logonForm";
    temp.id = "logonForm";
    temp.target = "_blank";
    temp.style.display = "none";
    for (var x in PARAMS) {
        var opt = document.createElement("input");
        opt.name = x;
        opt.value = PARAMS[x];
        // alert(opt.name)        
        temp.appendChild(opt);
    }
    document.body.appendChild(temp);
    temp.submit();
    return temp;
}

function redirectreport(URL, siteid, userdept, usercompany) {
    var user = 'report';
    var pwd = 'report';
    if (siteid == '102') {
        user = 'sanming';
        pwd = 'sanming';
    }
    else if (siteid == '103') {
        user = 'longyan';
        pwd = 'longyan';
    }
    else if (siteid == '104') {
        user = 'nanping';
        pwd = 'nanping';
    }
    else if (siteid == '105') {
        user = 'putian';
        pwd = 'putian';
    }
    else if (siteid == '106') {
        user = 'xiamen';
        pwd = 'xiamen';
    }
    else if (siteid == '107') {
        user = 'ningde';
        pwd = 'ningde';
    }
    else if (siteid == '108') {
        user = 'quanzhou';
        pwd = 'quanzhou';
    }
    else if (siteid == '109') {
        user = 'zhangzhou';
        pwd = 'zhangzhou';
    }
    else if (siteid == '110') {
        user = 'fuzhou';
        pwd = 'fuzhou';
    }
    else if (siteid == '114') {
        user = 'haitou';
        pwd = 'haitou';
    }
    else if (siteid == '101') {
        if (userdept == '中软海晟技术支持组') {
            user = 'haisheng';
            pwd = 'haisheng';
        }
        else if (userdept == '省局机关运维') {
            user = 'jiguan';
            pwd = 'jiguan';
        }
        else {
            user = 'sheng';
            pwd = 'sheng';
        }
    }
    report_post(URL, {
        username: user,
        password: pwd,
        reportedIP: '',
        reportedHostName: '',
        loc: 'zh_CN',
        appKind: 'InfoView',
        service: '/InfoViewApp/common/appService.do',
        useLogonToken: 'true',
        persistCookies: 'true',
        backContext: '/InfoViewApp',
        backUrlParents: '1',
        backUrl: '/listing/main.do',
        sessionCookie: 'true',
        prodName: 'BusinessObjects',
        appName: 'SAP BusinessObjects InfoView',
        isFromLogonPage: 'true',
        authType: 'secEnterprise',
        authenticationVisible: 'false',
        cms: 'FJYC-BO:6400',
        cmsVisible: 'false',
        qryStr: ''
    });
    return false;
}

$(function () {
    //适配屏幕高度
    $('.foot').css({ top: document.documentElement.scrollHeight - $('.foot').height() });
});